<include file="public/header"/>
<body>
<header>
<div class="tab_nav">
   <div class="header">
     <div class="h-left"><a class="sb-back" href="javascript:history.back(-1)" title="返回"></a></div>
     <div class="h-mid">我的订单</div>
     <div class="h-right">
       <aside class="top_bar">
         <div onClick="show_menu();$('#close_btn').addClass('hid');" id="show_more"><a href="javascript:;"></a> </div>
       </aside>
     </div>
   </div>
 </div>
</header>
<include file="public/menu"/>

<div id="tbh5v0">
<!--------筛选 form 表单 开始-------------->
<form action="{:U('Mobile/order_list/ajax_order_list')}" name="filter_form" id="filter_form">  
      <div class="Evaluation2">
            <ul>
              <li><a href="{:U('/Mobile/User/order_list')}" class="tab_head <if condition="$Request.param.type eq ''">on</if>"  >全部</a></li>
              <li><a href="{:U('/Mobile/User/order_list',array('type'=>'WAITPAY'))}"      class="tab_head <if condition="$Request.param.type eq 'WAITPAY'">on</if>">待付款</a></li>
              <li><a href="{:U('/Mobile/User/order_list',array('type'=>'WAITSEND'))}"     class="tab_head <if condition="$Request.param.type eq 'WAITSEND'">on</if>">待发货</a></li>
              <li><a href="{:U('/Mobile/User/order_list',array('type'=>'WAITRECEIVE'))}"  class="tab_head <if condition="$Request.param.type eq 'WAITRECEIVE'">on</if>">待收货</a></li>
              <li><a href="{:U('/Mobile/User/order_list',array('type'=>'WAITCCOMMENT'))}" class="tab_head <if condition="$Request.param.type eq 'WAITCCOMMENT'">on</if>">待评价</a></li>
            </ul>
      </div>     
      
	<div class="order ajax_return">
	   <volist name="lists" id="list">
       <div class="order_list">
          <h2>
              <a href="javascript:void(0);">
                  <img src="__STATIC__/images/dianpu.png"><span>订单号:{$list.order_sn}</span>
                  <strong><if condition="$list[order_status] eq 5"><b>已作废</b></if>
                  <img src="__STATIC__/images/icojiantou1.png"></strong>
              </a>
          </h2>
         	<a href="{:U('/Mobile/User/order_detail',array('id'=>$list['order_id']))}">
	          <volist name="list.goods_list" id="good">
		          <dl style="position: relative">  
		          <dt><img src="{$good.goods_id|goods_thum_images=200,200}"></dt>
		          <dd class="name"><strong>{$good.goods_name}</strong>
		          <span style="position: absolute;">{$good.spec_key_name} </span></dd>
		          <dd class="pice">￥{$good['member_goods_price']}元<em>x{$good['goods_num']}</em></dd>
				  <dd class="pice" style="width:80%">                  
                  	<em>
                        <if condition="($list[return_btn] eq 1) and ($good[is_send] eq 2)">
                          	<a href="{:U('Mobile/User/return_goods',array('order_id'=>$list[order_id],'order_sn'=>$list[order_sn],'goods_id'=>$good[goods_id],'spec_key'=>$good['spec_key']))}" style="color:#999;">申请售后</a>
                        </if>
                        
                    </em>
                  </dd>                  
                  <if condition="$list['order_status'] eq 3"><div style="position:absolute;right:10%;top:30px;width:13%;max-width:64px"><img src="__STATIC__/images/cancel_btn.png" width="100%"></div></if>
                  <if condition="($list['order_status'] lt 3) and ($list['pay_status'] eq 1) and ($list['shipping_status'] eq 0)"><div style="position:absolute;right:10%;top:30px;width:13%;max-width:64px"><img src="__STATIC__/images/wait_send_btn.png" width="100%"></div></if>
                  <if condition="($list['pay_status'] eq 0) and ($list['order_status'] eq 0)"><div style="position:absolute;right:10%;top:30px;width:13%;max-width:64px"><img src="__STATIC__/images/wait_pay_btn.png" width="100%"></div></if>
                  <if condition="($list['order_status'] lt 2) and ($list['shipping_status'] eq 1)"><div style="position:absolute;right:10%;top:30px;width:13%;max-width:64px"><img src="__STATIC__/images/wait_reciv_btn.png" width="100%"></div></if>
		          </dl>
	          </volist>
          	</a>
          <div class="pic">共{$list.goods_list|count}件商品<span>应付：</span><strong>￥{$list['order_amount']}元</strong></div>
          <div class="anniu" style="width:95%">

                <if condition="$list.cancel_btn eq 1"><span onClick="cancel_order({$list.order_id})">取消订单</span></if>

                <if condition="$list.pay_btn eq 1"><a href="{:U('Mobile/Cart/cart4',array('order_id'=>$list['order_id']))}">立即付款</a></if>
                <if condition="$list.receive_btn eq 1"><a href="{:U('Mobile/User/order_confirm',array('id'=>$list['order_id']))}">收货确认</a></if>    
                <if condition="$list.comment_btn eq 1"><a href="{:U('/Mobile/User/comment')}">评价</a></if>
                <if condition="$list.shipping_btn eq 1"><a href="{:U('User/express',array('order_id'=>$list['order_id']))}">查看物流</a></if>
          </div>
       </div>
		</volist>  
    </div>
  <!--查询条件-->
  <input type="hidden" name="type" value="{$Request.param.type}" />
</form>   
<notempty name="lists"> 
   <div id="getmore" style="font-size:.24rem;text-align: center;color:#888;padding:.25rem .24rem .4rem; clear:both">
  		<a href="javascript:void(0)" onClick="ajax_sourch_submit()">点击加载更多</a>
  </div>         
</notempty>    
</div>


<script language="javascript">
var  page = 1;
 
 /*** ajax 提交表单 查询订单列表结果*/  
 function ajax_sourch_submit()
 {	 	
 		page += 1; 	 
		$.ajax({
			type : "GET",
			url:"/index.php?m=Mobile&c=User&a=order_list&type={$Request.param.type}&is_ajax=1&p="+page,//+tab,
//			url:"{:U('Mobile/User/order_list',array('type'=>$_GET['type']),'')}/is_ajax/1/p/"+page,//+tab,			
			//data : $('#filter_form').serialize(),
			success: function(data)
			{
				if(data == '')
					$('#getmore').hide();
				else  
				{
					$(".ajax_return").append(data);			
					$(".m_loading").hide();
				}
			}
		}); 
 }
getmore
//取消订单
function cancel_order(id){
	if(!confirm("确定取消订单?"))
		return false;
	location.href = "/index.php?m=Mobile&c=User&a=cancel_order&id="+id;
}

</script>
</body>
</html>